package com.rd.student.ruanjian.class4.zhouzihe.day0802;

public class Store {
    public  Animal getInstance(Object str) {
        if (str.equals("dog")) {
            return new Dog();
        }else if (str.equals("pig")){
            return new Pig();
        }
        return new Cat();
    }
}

